//
// Dreams Gate Launcher
// www.dg8.ru
//
// GNU GPL v3
//
// DlgProxy.cpp : implementation file
//

#include "stdafx.h"
#include "qboot.h"
#include "DlgProxy.h"
#include "qbootDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// CqbootDlgAutoProxy

IMPLEMENT_DYNCREATE(CqbootDlgAutoProxy, CCmdTarget)

CqbootDlgAutoProxy::CqbootDlgAutoProxy()
{
	EnableAutomation();
	
	// To keep the application running as long as an automation 
	//	object is active, the constructor calls AfxOleLockApp.
	AfxOleLockApp();

	// Get access to the dialog through the application's
	//  main window pointer.  Set the proxy's internal pointer
	//  to point to the dialog, and set the dialog's back pointer to
	//  this proxy.
	ASSERT_VALID(AfxGetApp()->m_pMainWnd);
	if (AfxGetApp()->m_pMainWnd)
	{
		ASSERT_KINDOF(CqbootDlg, AfxGetApp()->m_pMainWnd);
		if (AfxGetApp()->m_pMainWnd->IsKindOf(RUNTIME_CLASS(CqbootDlg)))
		{
			m_pDialog = reinterpret_cast<CqbootDlg*>(AfxGetApp()->m_pMainWnd);
			m_pDialog->m_pAutoProxy = this;
		}
	}
}

CqbootDlgAutoProxy::~CqbootDlgAutoProxy()
{
	// To terminate the application when all objects created with
	// 	with automation, the destructor calls AfxOleUnlockApp.
	//  Among other things, this will destroy the main dialog
	if (m_pDialog != NULL)
		m_pDialog->m_pAutoProxy = NULL;
	AfxOleUnlockApp();
}

void CqbootDlgAutoProxy::OnFinalRelease()
{
	// When the last reference for an automation object is released
	// OnFinalRelease is called.  The base class will automatically
	// deletes the object.  Add additional cleanup required for your
	// object before calling the base class.

	CCmdTarget::OnFinalRelease();
}

BEGIN_MESSAGE_MAP(CqbootDlgAutoProxy, CCmdTarget)
END_MESSAGE_MAP()

BEGIN_DISPATCH_MAP(CqbootDlgAutoProxy, CCmdTarget)
END_DISPATCH_MAP()

// Note: we add support for IID_Iqboot to support typesafe binding
//  from VBA.  This IID must match the GUID that is attached to the 
//  dispinterface in the .IDL file.

// {7F02D7FF-1A12-4EC1-8C36-7CEF6D353726}
static const IID IID_Iqboot =
{ 0x7F02D7FF, 0x1A12, 0x4EC1, { 0x8C, 0x36, 0x7C, 0xEF, 0x6D, 0x35, 0x37, 0x26 } };

BEGIN_INTERFACE_MAP(CqbootDlgAutoProxy, CCmdTarget)
	INTERFACE_PART(CqbootDlgAutoProxy, IID_Iqboot, Dispatch)
END_INTERFACE_MAP()

// The IMPLEMENT_OLECREATE2 macro is defined in StdAfx.h of this project
// {3B9A5384-A66A-428B-A491-CFB41BDA5960}
IMPLEMENT_OLECREATE2(CqbootDlgAutoProxy, "qboot.Application", 0x3b9a5384, 0xa66a, 0x428b, 0xa4, 0x91, 0xcf, 0xb4, 0x1b, 0xda, 0x59, 0x60)


// CqbootDlgAutoProxy message handlers
